package single_game.logic.race_simulator.race_team.rider_actions;

import single_game.logic.race_simulator.Group;
import single_game.logic.race_simulator.RaceSimulator;
import single_game.logic.race_simulator.race_team.RaceRider;
import main.CyclingManager;

public class Relay {
	
	public static void simulateRiderAction(RaceRider rider) {
		
		if (rider.getRiderRole().equals("Team Mate"))  {
			if (rider.getEnergy() < 20.0) {
				rider.setAction("Maintain Position");
				Group group = RaceSimulator.findGroupById(rider.getGroupId());
				group.removeFromRelayGroup(rider);
			//	group.pushOutOfRelayGroup(rider);
				System.out.println("Relay -> Maintain "+CyclingManager.getInstance().cyclists.get(rider.getCyclistId()).getSurname()+" "+rider.getRiderRole());
			}
		}		
	}
}
